# 第一阶段：编译
FROM openjdk:8 AS build
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
COPY target/word2pdf-1.0-SNAPSHOT.jar /word2pdf.jar
# 第二阶段：最小化运行环境
FROM openjdk:8-jre-alpine
COPY --from=build /word2pdf.jar /word2pdf.jar
VOLUME /tmp
ENTRYPOINT ["java", "-jar", "/word2pdf.jar"]

#docker build -t word2pdf .
#docker run -it -d --network=host --name word2pdf word2pdf
#docker rm -f word2pdf
#docker rmi word2pdf
